package ru.inse.core.service.realty.impl;

import ru.inse.core.common.listeners.IEvent;
import ru.inse.core.domain.realty.RealtyItem;


public class RealtyItemChangedEvent
    implements IEvent
{
    public enum EventType {
        BEFORE_INSERT, AFTER_INSERT, BEFORE_DELETE, AFTER_DELETE, BEFORE_UPDATE, AFTER_UPDATE
    }

    private EventType type;
    private RealtyItem item;
    private Long cityId;

    

    static public RealtyItemChangedEvent newInstance(EventType type, RealtyItem item, Long cityId)
    {
        RealtyItemChangedEvent instance = new RealtyItemChangedEvent(type, item, cityId);
        return instance;
    }

    private RealtyItemChangedEvent(EventType type, RealtyItem item, Long cityId)
    {
        this.type = type;
        this.item = item;
        this.cityId = cityId;
    }

    public RealtyItem getRealtyItem()
    {
        return item;
    }
    public EventType getType()
    {
        return type;
    }

    public Long getCityId()
    {
        return cityId;
    }
}
